﻿<Window xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="Wokhan.WindowsFirewallNotifier.Notifier.UI.Windows.NotificationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:WFN="clr-namespace:Wokhan.WindowsFirewallNotifier.Common;assembly=Wokhan.WindowsFirewallNotifier.Common"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
        xmlns:settings="clr-namespace:Wokhan.WindowsFirewallNotifier.Common;assembly=Wokhan.WindowsFirewallNotifier.Common"
        xmlns:sampleApp="clr-namespace:Wokhan.WindowsFirewallNotifier.Notifier"
        Title="WFN - Notification" ResizeMode="NoResize"
        AllowsTransparency="True"
        Background="Transparent"
        SizeToContent="Height"
        Width="425"
        WindowStyle="None"
        Opacity="0.6"
        Icon="/Notifier;component/Resources/WFN.ico"
        Topmost="True"
        x:Name="NotifWindow"
        WindowStartupLocation="Manual"
        UseLayoutRounding="True"
        BorderThickness="0"
        ScrollViewer.CanContentScroll="False"
        DataContext="{Binding RelativeSource={RelativeSource Self}}" Visibility="Visible" Loaded="NotificationWindow_Loaded" Initialized="NotificationWindow_Initialized" MouseEnter="NotificationWindow_MouseEnter">
    <Window.Resources>
        <Storyboard x:Key="animate">
            <ThicknessAnimation Storyboard.TargetProperty="Margin" From="250,0,-250,0" To="0,0,0,0" Duration="0:0:0.5" />
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
        </Storyboard>
        <SolidColorBrush x:Key="AccentColorBrush" Color="Coral" />
        <SolidColorBrush x:Key="PressedColorBrush" Color="OrangeRed" />
        <WFN:Settings x:Key="WFN" />
        <Style x:Key="SplitButton" TargetType="Grid">
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Margin" Value="3" />
            <Style.Resources>
                <Style TargetType="{x:Type Button}">
                    <Setter Property="OverridesDefaultStyle" Value="True" />
                    <Setter Property="VerticalAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="Padding" Value="15,3,3,3" />
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type Button}">
                                <Border Name="border" VerticalAlignment="Stretch" CornerRadius="20,0,0,20" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource Mode=TemplatedParent}}" />
                                            <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="Button.IsPressed" Value="True">
                                        <Setter TargetName="border" Property="Background" Value="{DynamicResource PressedColorBrush}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="OverridesDefaultStyle" Value="True" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="BorderBrush" Value="Gray" />
                    <Setter Property="BorderThickness" Value="1,0,0,0" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ToggleButton}">
                                <Border Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,20,20,0" Width="35">
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource Mode=TemplatedParent}}" />
                                            <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
                                                </Trigger>
                                                <DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="True">
                                                    <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                    <Path Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="Gray" Stretch="Uniform" Data="F1 M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="Button.IsPressed" Value="True">
                                        <Setter TargetName="border" Property="Background" Value="{DynamicResource PressedColorBrush}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Style.Resources>
        </Style>
        <Style x:Key="RoundedButton" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="True" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Margin" Value="2" />
            <Setter Property="BorderBrush" Value="Transparent" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border Background="{TemplateBinding Background}" CornerRadius="20" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type ListView}">
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
        </Style>
        <Style TargetType="CheckBox">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Background" Value="White"/>
            <Setter Property="BorderThickness" Value="2" />
            <Setter Property="BorderBrush" Value="{DynamicResource AccentColorBrush}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <DockPanel Margin="{TemplateBinding Padding}" VerticalAlignment="Center" LastChildFill="True">
                            <Border Margin="0,0,5,0" VerticalAlignment="Center" CornerRadius="7" Width="30" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                                <Ellipse Margin="2" Width="7" Height="7" Fill="{TemplateBinding Foreground}">
                                    <Ellipse.Style>
                                        <Style TargetType="Ellipse">
                                            <Setter Property="HorizontalAlignment" Value="Left" />
                                            <Setter Property="Opacity" Value="0.3" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsChecked,RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="True">
                                                    <Setter Property="HorizontalAlignment" Value="Right" />
                                                    <Setter Property="Opacity" Value="1" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Ellipse.Style>
                                </Ellipse>
                            </Border>
                            <ContentPresenter Margin="{TemplateBinding Padding}" />
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="BorderBrush" Value="LightGray" />
                    <Setter Property="Foreground" Value="Gray" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Border x:Name="Main" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderThickness="1" BorderBrush="LightGray">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <TextBlock Background="{DynamicResource AccentColorBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Padding="10,5" Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrush}}" FontWeight="Bold" Text="{Binding Source={x:Static WFN:Resources.FW_TITLE}}" />
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Background="{DynamicResource AccentColorBrush}" Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrush}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderThickness="2" Width="30" Height="30" Click="btnPrev_Click">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource RoundedButton}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding NbConnectionsBefore}" Value="0">
                                        <Setter Property="IsEnabled" Value="False" />
                                        <Setter Property="Opacity" Value="0.5" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <WrapPanel>
                            <TextBlock Text="{Binding NbConnectionsBefore,FallbackValue='0',StringFormat='&lt;{0}'}" FontSize="10">
                                <TextBlock.Style>
                                    <Style TargetType="TextBlock">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding NbConnectionsBefore}" Value="0">
                                                <Setter Property="Visibility" Value="Collapsed" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </TextBlock.Style>
                            </TextBlock>
                        </WrapPanel>
                    </Button>
                    <Button Background="{DynamicResource AccentColorBrush}" Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrush}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderThickness="2" Width="30" Height="30" Click="btnNext_Click">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource RoundedButton}">
                                <Setter Property="IsEnabled" Value="True" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding NbConnectionsAfter}" Value="0">
                                        <Setter Property="IsEnabled" Value="False" />
                                        <Setter Property="Opacity" Value="0.5" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <WrapPanel>
                            <TextBlock Text="{Binding NbConnectionsAfter,FallbackValue='0',StringFormat='\{0}&gt;'}" FontSize="10">
                                <TextBlock.Style>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="Visibility" Value="Visible" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding NbConnectionsAfter}" Value="0">
                                                <Setter Property="Visibility" Value="Collapsed" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </TextBlock.Style>
                            </TextBlock>
                        </WrapPanel>
                    </Button>
                    <Button Foreground="White" Style="{StaticResource RoundedButton}" Background="{DynamicResource AccentColorBrush}" BorderBrush="White" BorderThickness="2" Content="0" FontFamily="Marlett" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Click="btnMin_Click" Margin="2,0" Padding="5,0" />
                </StackPanel>
            </Grid>
            <Expander Grid.Row="2" Background="LightYellow" Margin="0,5,0,0" Header="Advanced" SizeChanged="expand_SizeChanged" DockPanel.Dock="Bottom" x:Name="expand" IsExpanded="{Binding AlwaysShowDetails,Source={x:Static settings:Settings.Default}}">
                <Grid x:Name="gridExpand" Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}" DataContext="{Binding SelectedItem, ElementName=lstConnections}">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*" />
                        <ColumnDefinition Width="0.5*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Margin="3" Grid.ColumnSpan="2">
                        <Hyperlink TextDecorations="" NavigateUri="{Binding CurrentPath}" RequestNavigate="hlkPath_Navigate">
                            <TextBlock Text="{Binding CurrentPath, FallbackValue='N/A', StringFormat='Path: {0}'}"></TextBlock>
                        </Hyperlink>
                    </TextBlock>
                    <CheckBox Grid.Row="1" Margin="3" IsChecked="{Binding OptionsView.IsCurrentProfileChecked, ElementName=NotifWindow}" Content="{Binding CurrentProfile, ElementName=NotifWindow, FallbackValue='Unknown'}" ContentStringFormat="Profile: {0}" />
                    <CheckBox Grid.Row="1" Grid.Column="1" Margin="3" IsChecked="{Binding OptionsView.IsProtocolChecked, ElementName=NotifWindow}" Content="{Binding ProtocolAsString,FallbackValue='Unknown'}" ContentStringFormat="Protocol: {0}" />
                    <CheckBox Grid.Row="2" Margin="3" IsChecked="{Binding OptionsView.IsLocalPortChecked, ElementName=NotifWindow}" ToolTipService.ShowOnDisabled="True">
                        <TextBlock Text="{Binding LocalPort,FallbackValue='N/A', StringFormat='Local port: {0}'}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" />
                        <CheckBox.ToolTip>
                            <StackPanel>
                                <TextBlock FontWeight="Bold">Local ports:</TextBlock>
                                <TextBlock Text="{Binding LocalPort}" />
                            </StackPanel>
                        </CheckBox.ToolTip>
                    </CheckBox>
                    <CheckBox Grid.Row="2" Grid.Column="1" x:Name="chkService" Margin="3" IsChecked="{Binding OptionsView.IsServiceRuleChecked, ElementName=NotifWindow}">
                        <CheckBox.Style>
                            <Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
                                <Setter Property="Content" Value="No service found." />
                                <Setter Property="IsEnabled" Value="False" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding OptionsView.IsService, ElementName=NotifWindow}" Value="True">
                                        <Setter Property="IsEnabled" Value="True" />
                                        <Setter Property="Content" Value="{Binding CurrentServiceDesc, FallbackValue='N/A'}"/>
                                        <Setter Property="ContentStringFormat" Value="Service: {0}"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding OptionsView.IsServiceMultiple, ElementName=NotifWindow}" Value="True">
                                        <Setter Property="IsEnabled" Value="True" />
                                        <Setter Property="Content" Value="Multiple services found" />
                                        <Setter Property="Foreground" Value="Red" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </CheckBox.Style>
                    </CheckBox>
                    <CheckBox Grid.Row="3" Margin="3" IsChecked="{Binding OptionsView.IsTargetPortChecked, ElementName=NotifWindow}" Content="{Binding TargetPort,FallbackValue='N/A'}" ContentStringFormat="Target port: {0}" />
                    <CheckBox Grid.Row="3" Grid.Column="1" Margin="3" IsChecked="{Binding OptionsView.IsTargetIPChecked, ElementName=NotifWindow}" Content="{Binding Target, FallbackValue='N/A'}" ContentStringFormat="Target: {0}" />
                    <CheckBox Grid.Row="4" Grid.ColumnSpan="2" Margin="3" IsEnabled="{Binding OptionsView.IsAppEnabled, ElementName=NotifWindow}" IsChecked="{Binding OptionsView.IsAppChecked, ElementName=NotifWindow}" Content="{Binding CurrentAppPkgId,FallbackValue='N/A'}" ContentStringFormat="App: {0}" /><!--FIXME: Really needs ellipses-->
                    <!--<CheckBox Grid.Row="5" Grid.ColumnSpan="2" Margin="3" IsChecked="{Binding OptionsView.IsTempRuleChecked, ElementName=NotifWindow}" Content="Only apply this choice now and ask again the next time" />-->
                </Grid>
            </Expander>
            <Button Grid.Row="2" Style="{StaticResource RoundedButton}" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="6" Margin="2" Background="{DynamicResource AccentColorBrush}" BorderThickness="0" Click="btnOptions_Click" Height="30" Width="30">
                <Path Stretch="Uniform" Fill="White" Data="F1 M 54.8392,24.4749C 55.3507,24.2457 55.8111,24.1311 56.2202,24.1311C 56.6172,24.1311 56.966,24.2232 57.2668,24.4073C 57.5675,24.5915 57.8171,24.8339 58.0156,25.1347L 58.4575,26.1536L 58.6017,27.2737C 58.6017,29.6143 58.4667,31.8014 58.1966,33.8351C 57.9266,35.8688 57.5522,37.7644 57.0734,39.5218C 56.5947,41.2793 56.0289,42.8997 55.3763,44.383C 54.7236,45.8663 54.0167,47.232 53.2556,48.4801C 52.4946,49.7281 51.6925,50.8636 50.8496,51.8866C 50.0067,52.9095 49.1556,53.8302 48.2963,54.6486C 45.2682,57.5252 41.8351,59.6285 37.9969,60.9583C 34.1505,59.6285 30.7174,57.5252 27.6976,54.6486C 26.4086,53.421 25.1463,51.9633 23.9105,50.2754C 22.6748,48.5875 21.5751,46.6244 20.6114,44.3861C 19.6478,42.1478 18.8713,39.616 18.2821,36.7905C 17.6929,33.965 17.3982,30.7928 17.3982,27.2737L 17.5609,26.1413L 18.0397,25.1439C 18.2504,24.8493 18.5123,24.613 18.8253,24.435C 19.1383,24.257 19.4933,24.168 19.8902,24.168C 20.2871,24.168 20.7106,24.2703 21.1608,24.4749C 22.196,24.9495 23.1484,25.2851 24.0179,25.4815C 24.8875,25.6779 25.6925,25.7761 26.4332,25.7761C 27.4193,25.7761 28.3052,25.6298 29.0909,25.3372C 29.8765,25.0447 30.5987,24.6743 31.2575,24.2263L 33.0805,22.787L 34.7009,21.3476L 36.2906,20.2336C 36.8266,19.939 37.3954,19.7917 37.9969,19.7917C 38.6107,19.7917 39.1866,19.939 39.7247,20.2336L 41.3175,21.3476L 42.9471,22.787L 44.7701,24.2263C 45.4227,24.6743 46.1419,25.0447 46.9275,25.3372C 47.7132,25.6298 48.5991,25.7761 49.5852,25.7761C 50.3258,25.7761 51.1279,25.6779 51.9913,25.4815C 52.8546,25.2851 53.804,24.9495 54.8392,24.4749 Z" />
            </Button>
            <StackPanel Grid.Row="1" x:Name="gridConnections" Background="#EEEEEE">
                <ListView VirtualizingPanel.ScrollUnit="Item" SelectedIndex="0" SelectionMode="Single" x:Name="lstConnections" Background="Transparent" ItemsSource="{Binding Connections}" DataContext="{x:Static Application.Current}" d:DataContext="{d:DesignInstance Type=sampleApp:AppDataSample, IsDesignTimeCreatable=True}">
                    <ListView.ItemContainerStyle>
                        <Style TargetType="ListViewItem">
                            <Setter Property="OverridesDefaultStyle" Value="True"/>
                            <Setter Property="Padding" Value="0" />
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ListViewItem">
                                        <ContentPresenter />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Trigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard Duration="0:0:1" SpeedRatio="2">
                                                <!--<ThicknessAnimation From="100,0,0,0" To="0,0,0,0" Storyboard.TargetProperty="Margin" />-->
                                                <DoubleAnimation From="0" To="1" Storyboard.TargetProperty="Opacity" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.EnterActions>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ListView.ItemContainerStyle>
                    <ListView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ListView.ItemsPanel>
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <Grid Width="{Binding ActualWidth,ElementName=gridConnections}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Image Margin="5,0,0,0"  Grid.Column="0" Height="32" MinWidth="32" RenderOptions.BitmapScalingMode="HighQuality" Source="{Binding Icon}" />
                                <StackPanel Margin="5" Grid.Column="1">
                                    <TextBlock FontWeight="Bold" Text="{Binding CurrentProd}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
                                    <TextBlock Text="{Binding Editor}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" FontSize="10" />
                                </StackPanel>
                                <TextBlock Margin="5,5" Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Text="{Binding TentativesCounter,StringFormat='Attempts: {0}'}" FontSize="10" />
                            </Grid>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <Canvas>
                    <Border Canvas.Top="20" Canvas.Left="3" Width="{Binding ActualWidth,ElementName=sbAllow}" CornerRadius="0,0,20,20" Padding="0,15,0,0" Background="{DynamicResource AccentColorBrush}">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsChecked,ElementName=tglAllow}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Button Margin="2" Style="{StaticResource RoundedButton}" Background="WhiteSmoke" Height="{Binding ActualHeight,ElementName=btnIgnore}" x:Name="btnAllowTemp" Click="btnAllowTemp_Click">Allow temporarily</Button>
                    </Border>
                    <Border Canvas.Top="20" Canvas.Left="144" Width="{Binding ActualWidth,ElementName=sbIgnore}" CornerRadius="0,0,20,20" Padding="0,15,0,0" Background="{DynamicResource AccentColorBrush}">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsChecked,ElementName=tglBlock}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Button Margin="2" Style="{StaticResource RoundedButton}" Background="WhiteSmoke" Height="{Binding ActualHeight,ElementName=btnIgnore}" x:Name="btnBlockTemp" Click="btnBlockTemp_Click">Block temporarily</Button>
                    </Border>
                    <Border Canvas.Top="20" Canvas.Left="285" Width="{Binding ActualWidth,ElementName=sbSkip}" CornerRadius="0,0,0,0" Padding="0,15,0,0" Background="{DynamicResource AccentColorBrush}">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsChecked,ElementName=tglSkip}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Button Margin="2" Style="{StaticResource RoundedButton}" Background="WhiteSmoke" Height="{Binding ActualHeight,ElementName=btnSkip}" x:Name="btnSkipProgram" Click="btnSkipProgram_Click">Skip program</Button>
                    </Border>
                    <Border Canvas.Top="71" Canvas.Left="285" Width="{Binding ActualWidth,ElementName=sbSkip}" CornerRadius="0,0,20,20" Padding="0,0,0,0" Background="{DynamicResource AccentColorBrush}">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsChecked,ElementName=tglSkip}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Button Margin="2" Style="{StaticResource RoundedButton}" Background="WhiteSmoke" Height="{Binding ActualHeight,ElementName=btnSkip}" x:Name="btnSkipAll" Click="btnSkipAll_Click">Skip all</Button>
                    </Border>
                </Canvas>
                <UniformGrid Rows="1" Columns="3">
                    <Grid Style="{StaticResource SplitButton}" x:Name="sbAllow">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button x:Name="btnAllow" HorizontalAlignment="Stretch" Background="LightGray" Click="btnAllow_Click" ToolTip="{Binding Source={x:Static WFN:Resources.MSG_ALLOW}}" HorizontalContentAlignment="Center">
                            <WrapPanel>
                                <Path Height="18" Stretch="Uniform" Fill="#FF4AAA4A" Data="F1 M 32.222,33.4875L 39.1886,40.0582L 51.3802,26.1251L 54.7052,29.0542L 39.5845,47.5L 28.897,36.8125L 32.222,33.4875 Z M 24,27L 48.5,27L 45.5,30L 27,30L 27,49L 46,49L 46,42.5L 49,38.75L 49,52L 24,52L 24,27 Z" />
                                <Label Content="{Binding Source={x:Static WFN:Resources.FW_RULE_ALLOW}}" VerticalContentAlignment="Center" />
                            </WrapPanel>
                        </Button>
                        <ToggleButton Grid.Column="1" Background="LightGray" x:Name="tglAllow" />
                    </Grid>
                    <Grid Style="{StaticResource SplitButton}" x:Name="sbIgnore">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button x:Name="btnIgnore" Background="LightGray" Click="btnIgnore_Click" ToolTip="{Binding Source={x:Static WFN:Resources.MSG_BLOCK}}" HorizontalContentAlignment="Center">
                            <WrapPanel>
                                <Path Height="20" Stretch="Uniform" Fill="#FFDE6032" Data="F1 M 31.6667,19L 44.3333,19L 57,31.6667L 57,44.3333L 44.3333,57L 31.6667,57L 19,44.3333L 19,31.6667L 31.6667,19 Z M 26.4762,45.0454L 30.9546,49.5238L 38,42.4783L 45.0454,49.5238L 49.5237,45.0454L 42.4783,38L 49.5238,30.9546L 45.0454,26.4763L 38,33.5217L 30.9546,26.4762L 26.4762,30.9546L 33.5217,38L 26.4762,45.0454 Z"/>
                                <Label Content="{Binding Source={x:Static WFN:Resources.FW_RULE_BLOCK}}" VerticalContentAlignment="Center" />
                            </WrapPanel>
                        </Button>
                        <ToggleButton Grid.Column="1" Background="LightGray" x:Name="tglBlock" />
                    </Grid>
                    <Grid Style="{StaticResource SplitButton}" x:Name="sbSkip">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button x:Name="btnSkip" Background="LightGray" Click="btnSkip_Click" HorizontalContentAlignment="Center">
                            <WrapPanel>
                                <Path Height="18" Stretch="Uniform" Data="M3,8H5V16H3V8M7,8H9V16H7V8M11,8H13V16H11V8M15,19.25V4.75L22.25,12L15,19.25Z" Fill="#FF599CEC" />
                                <Label Content="Skip" VerticalContentAlignment="Center" />
                            </WrapPanel>
                        </Button>
                        <ToggleButton Grid.Column="1" Background="LightGray" x:Name="tglSkip" />
                    </Grid>
                </UniformGrid>
            </StackPanel>
        </Grid>
    </Border>
</Window>
